package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-06-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_contact_details")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class GuContactDetails extends Model<GuContactDetails> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "cd_id", type = IdType.AUTO)
    private Integer cdId;

    /**
     * 标题
     */
    private String cdTitle;

    /**
     * 图片
     */
    private String cdImageUrl;

    /**
     * 联系账号
     */
    private String cdAccount;

    /**
     * 二维码地址
     */
    private String cdQrCode;

    /**
     * 越小越靠前
     */
    private Integer cdSort;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cdCreateTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cdUpdateTime;


    @Override
    protected Serializable pkVal() {
        return this.cdId;
    }

}
